<?php

use App\Model\InverterData;
use Illuminate\Database\Seeder;

class InverterDataSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        InverterData::unguard();
        $time = time();
        for ($i = 0; $i < 20; $i++) {
            $d = new InverterData();
            $d->device_id = 1;
            $d->user_id = 2;
            $d->site_id = 1;

            $d->DCI1 = random_int(1, 20);
            $d->DCI2 = random_int(1, 20);
            $d->DCI3 = random_int(1, 20);
            $d->DCI4 = random_int(1, 20);
            $d->DCU1 = random_int(1, 20);
            $d->DCU2 = random_int(1, 20);
            $d->DCU3 = random_int(1, 20);
            $d->DCU4 = random_int(1, 20);
            $d->ACUA = random_int(1, 20);
            $d->ACIA = random_int(1, 20);
            $d->ACUB = random_int(1, 20);
            $d->ACIB = random_int(1, 20);
            $d->ACUC = random_int(1, 20);
            $d->ACIC = random_int(1, 20);

            $d->created_at = date('Y-m-d H:i:s', $time + 300);
            $d->updated_at = date('Y-m-d H:i:s', $time + 300);

            $d->save();

            $time = $time + 300;
        }


    }


}
